@extends('layouts.admin')
@section('title') @parent 圈子成员列表 @stop
@section('page_title')@parent
圈子成员列表
@show
@section('breadcrumb')@parent
{{ Breadcrumbs::render('circle-members-index')  }}
@show
@section('content')
<div class="box">
		<div class="box-header">
			<h3 class="box-title">圈子{{$circle->group_name}}的成员</h3>
		</div>
		<div class="box-body table-responsive">	
				@include('widgets.notification')
				<div class="pad">
					
				</div>
				
				<table class="table table-bordered table-hover dataTable">
					<thead>
					<tr>
						<th>名称</th>
						<th>身份</th>
						<th>是否群主</th>
						<th>是否管理员</th>
						<th>操作</th>
					</tr>
					</thead>
					<tbody>
							@if(count($members)>0)
							@foreach ($members as $item)
							<tr>
								<td>{{ $item->user->realname() }}</td>
								<td>@if ($item->user->group->model=='Lawyer' ) 律师 @else 普通用户 @endif </td>
								<td>
									{{{ $item->is_creator ? '是' :'否' }}}
								</td>
								<td>{{{ $item->is_admin ? '是' :'否' }}}</td>
								<td>
									<a href="{{ route('admin.circle.member.setcreator', ['id'=>$circle->id, 'user_id'=>$item->user_id]) }}">{{{  $item->is_creator?'取消':'设为' }}}群主</a>&nbsp;&nbsp;
									<a href="{{ route('admin.circle.member.setadmin', ['id'=>$circle->id, 'user_id'=>$item->user_id]) }}">{{{  $item->is_admin?'取消':'设为' }}}管理员</a>&nbsp;&nbsp;
									<a title="移除成员" href="{{ route('admin.circle.member.remove', ['id'=>$circle->id, 'user_id'=>$item->user_id]) }}" onclick="return confirm('确定要删除该成员么？')" class="btn-del">&nbsp;&nbsp;<span class="glyphicon glyphicon-remove danger"></span></a>
								</td>
							</tr>
							@endforeach
							@endif
					</tbody>
				</table>
		</div>
		<div class="box-footer clearfix">
			{{ $members->appends(Input::except('page'))->links() }}
		</div>
</div>
@stop
@section('end') @parent
@stop